#############################################
#############################################
## This Makefile is in chrge of building   ##
## the test for the fat_read and fat_write ##
## function.                               ##
#############################################
#############################################
#
# Include dir
INC = -I /usr/include/CUnit/ -I ../../Src/Include/
# Compiler
CC = gcc
# Compiler flags
CFLAGS = -Wall -pedantic -g
# Where the libfat lib lives
LIB_PATH = -L ../../lib/


.PHONY: test clean

rw_test: ../../bin/libfat.a rw_suite.o rw_test.o 
	$(CC)  $(LIB_PATH) -o rw_test $^ -lcunit -lfat 

rw_test.o:  rw_test.c
	$(CC) $(CFLAGS) $(INC) -c $<

rw_suite.o: rw_suite.c
	$(CC) $(CFLAGS) $(INC) -c $<

# Target for running format test. 
test: rw_test
	./rw_test
	@echo -e "\n\n\a *** Test read/write superato! ***\n"

clean:
	rm -f *.o
	rm -f rw_test
	rm -f *~